package com.zwl.demo.graph.relationship;


import com.zwl.demo.graph.node.BaseNode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.neo4j.ogm.annotation.EndNode;
import org.neo4j.ogm.annotation.Property;
import org.neo4j.ogm.annotation.RelationshipEntity;
import org.neo4j.ogm.annotation.StartNode;

@Data
@RelationshipEntity(type = "RELATION")
@EqualsAndHashCode(callSuper = false)
public class Relation<S extends BaseNode, E extends BaseNode> extends BaseRelation {

    @StartNode
    private S start;

    @Property
    private String type;

    @EndNode
    private E end;


    public Relation(S start, E end, String type) {
        this.start = start;
        this.end = end;
        this.type = type;
    }
}
